%simple script, which shows how adaptive_cost.m works
%fid = fopen('input/input.txt');
%x = fread(fid);
%fclose(fid);
jp2 = readj2k('input/l.jp2');
x = jp2{1, 1}{1, 1}.data;
x = abs(round(x));

x = x - min(min(x));
alphabet_size = max(max(x)) + 1;
fprintf('Large data stream \n');
[bits, p] = adaptive_cost_KT(x, alphabet_size);
fprintf('Non logarithm mode. Bits = %d \n', bits);
